#!/bin/sh

set +x
project=$1
env=$2
output="git-status-${project}-${env}.txt"

echo 'git提交详情:' > $output
(git log --oneline ${CI_COMMIT_SHORT_SHA}^..${CI_COMMIT_SHORT_SHA}) >> $output
echo '更改的文件:' >> $output
(git diff --name-status --oneline HEAD^) >> $output

rsync -e "ssh -o StrictHostKeyChecking=no" -av \
  $output \
  ubuntu@212.129.164.220:/usr/share/nginx/html/sourcemap/git-status/